<template>
	<view class="goodsWrap" @click.stop="getnav('/pagesC/shop/storeDetails?shop_id='+info.shop_id)">
		<slot></slot>

		<u-image width="100%" height="350rpx" :src="info.thumb_url" border-radius="8rpx 8rpx 0 0">
		</u-image>

		<view class="priceWrap">
			<img :src="info.logo" class="rounded-image" />
			{{ info.goods_name }}</p>
			<view>
				<view v-if="info.zonghe_fen != 0" class="pingfen">{{info.zonghe_fen}}分 <span class="xiaoliang" v-if="info.shop_sale_num > 500">销量{{info.shop_sale_num}}+</span></view>	
				<view v-if="info.free_freight != 0" class="manjian">满{{info.free_freight}}元免费配送</view>
			</view>
			<view class="bottom">
				<view class="moreAction" v-if="false">···</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		name: "homeCard",
		props: {
			info: {
				type: Object,
				default: function() {
					return {}
				},
			}  
		},
		 computed:{
		      tagList(){
		        return [
		            '自营',
		            '秒杀',
		            '团购',
		            '拼团',
		        ]
		      }
		  },
	}
</script>

<style lang="scss" scoped>
	@font-face {
		font-family: pangmen;
		src: url('https://woshop-1258844920.cos.ap-nanjing.myqcloud.com/static/font/futurabq-medium_0.otf'),
	}

	@font-face {
		font-family: pangmen;
		src: url('https://woshop-1258844920.cos.ap-nanjing.myqcloud.com/static/font/nexa.ttf'),
	}

	.goodsWrap {
		background: #fff;
		border-radius: 12rpx;
		overflow: hidden;
		margin: 8rpx;
		flex-shrink: 0;

		.priceWrap {
			padding: 12rpx;

			.badeg-self {
				font-size: 10px;
				padding: 4rpx 8rpx;
				border-radius: 100rpx;
				display: inline-block;
				color: #fff;
				background-image: linear-gradient(to right, #ffa468, #fa3f3f);
				line-height: 1;
				margin-right: 8rpx;
			}

			.bottom {
				display: flex;
				align-items: center;
				line-height: 60rpx;
				.moreAction {
					color: #aeb4bb;
					font-weight: 800;
					font-size: 40rpx;
					letter-spacing: -4px;
					margin-right: 14rpx;
				}
			}
		
			.pingfen {
				color: #86848b;
				font-size: 26rpx;
				.xiaoliang {
					margin-left: 10rpx;
				}
			}
			
			.rounded-image {
			  width: 25px;
			  height: 25px;
			  border-radius: 50%;
			  object-fit: cover;
			  margin-right: 10px;
			}
			
			.manjian {
			  display: inline-block;
			  padding: 2px 2px;
			  border: 1px solid #fa3f3f;
			  border-radius: 4px;
			  color: #fa3f3f;
			  font-size: 10px;
			  background-color: #fff;
			  box-sizing: border-box;
			}
			
			.tag{
				padding: 2rpx 4rpx;
				margin: 5rpx 5rpx 5rpx 0;
			}

			.name {
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				// -webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				line-height: 1.4;
				font-size: 28rpx;
				letter-spacing: 1.75rpx;
				margin: 8rpx 0;
				color: #444;
				word-break:break-all;
			}
		}

		.coupon {
			width: 24rpx;
			height: 16rpx;
		}
	}

	.currency {
		color: #666;
		font-size: 24rpx;
		margin-left: 8rpx;
	}
</style>
